package demo3;

public class Test {

    public static void eat(Animal animal){
        animal.eat();
    }

    public static void run(Iruning iruning){
        iruning.run();
    }

    public static void fly(Iflying iflying){
        iflying.fly();
    }

    public static void swim(Iswimming iswimming){
        iswimming.swim();
    }

    public static void main(String[] args) {
        //swim(new Dog());
        run(new Robot());
    }

    public static void main1(String[] args) {
        Dog dog = new Dog("小花狗",11);
        Duck duck = new Duck("鸭子",2);
        Bird bird =new Bird("燕子",8);
        /*dog.eat();
        duck.eat();
        bird.eat();*/

        run(dog);
        swim(dog);

        run(duck);
        fly(duck);
        swim(duck);

        fly(bird);


    }
}
